﻿@{
    ViewBag.Title = "Index";
}
@using Liya.Crm.Data.Models

    <link href="@Url.Content("~/Content/css/default.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/gh-buttons.css")" rel="stylesheet" type="text/css" />
    
    <script type="text/javascript">
        $(document).ready(function () {
            $("a.tab").click(function () {
                $(".current").removeClass("current");
                $(this).addClass("current");
                $("#topBar_dvSubNav ul").each(function () {
                    $(this).hide();
                });
                var child = $(this).parent().attr("id");
                $("#s" + child).show();
            });

            $("#main").load(function () {
                var mainheight = $(this).contents().find("body").height() + 30;
                $(this).height(mainheight);
            });
        });

        
    </script>

    <div class="wrap" id="Wrapper">
        <div class="head">
            <span class="logo">Liya CRM</span>
            <div id="topBar_dvMainNav" class="nav_main">
                <ul id="ulMenu">
                    <li child="0"><a href='#' class='tab current'>首页</a></li>
                     @foreach (var item in ViewData["FirstMenu"] as IEnumerable<Sys_Function>)
                     {
                         <li id="@item.FId"><a href='#' class="tab">@item.FName</a></li>
                     }
                </ul>
            </div>
            <div class="nav_top">
                <ul>
                    <li id="topBar_navSubUser" class="username noborder">欢迎 </li>
                    <li> @Html.ActionLink("退出", "SignOut", "UserInfo", "",new { @id = "NavSubLogout" })</li>
                </ul>
            </div>
        </div>
        <div id="topBar_dvSubNav" class="nav_sub">
            <ul id="s0">
                
            </ul>
            @foreach (KeyValuePair<int, IEnumerable<Sys_Function>> item in ViewData["SecondMenu"] as Dictionary<int, IEnumerable<Sys_Function>>)
            { 
                 <ul id="s@{@item.Key}" style="display:none">
                    @foreach (var menu in item.Value)
                    {
                        <li><a href='@(string.IsNullOrEmpty(menu.FUrl) ? "#" : menu.FUrl)' target="frameMain">@menu.FName</a></li>
                    }
                 </ul>
            }
            <div class='clear'>
            </div>
        </div>
        <div class="content">
            <iframe src="/Home/Desktop" id="frameMain" name="frameMain" width="100%" height="500" frameborder="0" scrolling="auto"></iframe>
        </div>
        <div id="footer">
            <div id="footBar_foot" class="foot-nav">
            </div>
            <div id="copyright">
            </div>
            <div class="yqlink">
            </div>
        </div>
    </div>

